/**
 * @file categories/greedy/poj3312/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/18 20:09:12
 **/

#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
char s[100];
int len[1005];
int main() {
  // High rating and good luck!
  int n, k, ks = 1;
  while (~scanf("%d%d", &n, &k) && (n || k)) {
    for (int i = 0; i < n; ++i) {
      scanf("%s", &s);
      len[i] = strlen(s);
    }
    sort(len, len + n);
    bool ok = true;
    for (int i = 0; i < n; i += k) {
      int sum = 0, mx = 0, mn = 100;
      for (int j = i; j < i + k; ++j) {
        sum += len[j];
        mn = min(mn, len[j]);
        mx = max(mx, len[j]);
      }
      if (sum > (mn + 2) * k || sum < (mx - 2) * k) ok = false;
    }
    if (ks != 1) putchar('\n');
    printf("Case %d: %s\n", ks++, ok ? "yes\n" : "no\n");
  }
  return 0;
}
